

Promise.prototype.catch2=function(Onrejected){
    return this.then(undefined,Onrejected)
}
const p=new Promise((resolve,reject)=>{
    // resolve(1)
    reject('error2')
}) 
p.then(res=>console.log('res:',res)).catch2(error=>console.log('error:',error))